class Solution {
public:
    int maxDepth(TreeNode* root) 
    {
        int a = 0, b = 0;
        
        if(root == NULL)
            return 0;
        else 
        {
            a = maxDepth(root -> left);   
            b = maxDepth(root -> right);
        }

        return max(a, b) + 1;
    }
};
